<template>
	<view>
		<ocr-id :type="type" :title="ocrTitle" @complete="onComplete" :imageOutput="imageOutput" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 'avatar', //type参数为”emblem“，或”avatar“
				imageOutput: 'roi', //imageOutput参数为“global”或者“roi”   
				ocrTitle: '识别身份证',
			}
		},
		onUnload() {
			uni.$off()
		},
		methods: {
			onComplete(data) {
				console.log(111);
				const res = data.detail.__args__[0].result[0]
				console.log(res.body[0]);
				uni.$emit('selectFile', res.body[0])
				uni.navigateBack()
			},
		}
	}
</script>

<style>

</style>